<div class="main">
			<?php
                $this->load->view('layout/left_small');
            ?>
            <div class="shop-r">
            	<div class="top-shop">
                	<span>Có <b><?php echo $num_rows;?></b> sản phẩm  |  Sắp xếp theo</span>
                	<form name="form_sort_order"> 
                    <select name="order_type" style="margin:3px 0 0 5px;" onChange="">
                    	<option value="1">Sắp xếp theo thứ tự</option>
                        <option value="2">Giá từ thấp đến cao</option>
                        <option value="3">Giá từ cao xuống thấp</option>
                    </select>
                    </form>
                </div>
                
                <?php if(isset($all_products) && $all_products != null) {?>
                <?php foreach($all_products as $k => $v) {?>
                <div class="line-shop">                	
                	<a href="<?php echo base_url().'show-room/detail/'.$v->id.'/'.$v->name_link.'.html';?>">
                		<?php $img_path = $this->home_model->get_images_products_by_product_id($v->id);?>
                		<?php if(isset($img_path) && $img_path != null) {?>
                			<img onerror="this.src='<?php echo img_link("no_image.gif");?>'" src="<?php echo site_url($img_path[0]->img_path);?>" title="<?php echo utf8_to_ascii($v->name);?>" alt="<?php echo utf8_to_ascii($v->name);?>" class="thumb" />
                		<?php } else {?>
                			<img src="<?php echo img_link('no_image.gif');?>" title="" alt="" class="thumb" />
                		<?php }?>
                	</a>
                    <div class="infosp-r">
                        <h2><a href="<?php echo base_url().'show-room/detail/'.$v->id.'/'.$v->name_link.'.html';?>" title="<?php echo $v->name;?>"><?php echo $v->name;?></a></h2>
                        <ul>
                            <li>Mã sản phẩm: <?php echo $v->code;?></li>
                            <li>Thương hiệu: <?php echo $v->company_name;?></li>
                            <li>Xuất xứ: <?php echo $v->country;?></li>	
                        </ul>
                    </div>
                    <div class="price">
                        <font class="pr">Giá: <?php echo format_type_money($v->price);?> VNĐ</font><br />
                        <p><a href="<?php echo base_url().'dat-hang/dat-hang/'.$v->code;?>" class="btn-dat">Đặt hàng</a></p>
                    </div>
                </div>
                <?php }?>
                <?php } else {?>
                <div class="line-shop"><font color="red">Không tìm thấy sản phẩm nào phù hợp!</font></div>
                <?php }?>
                                
                <div class="pagination panaging">                
                    <?php echo $pagnav;?>
                </div>
                
            </div>
        </div>